<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/monitoring/v3/metric_service.proto

namespace Google\Cloud\Monitoring\V3;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * The `CreateTimeSeries` request.
 *
 * Generated from protobuf message <code>google.monitoring.v3.CreateTimeSeriesRequest</code>
 */
class CreateTimeSeriesRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * The project on which to execute the request. The format is
     * `"projects/{project_id_or_number}"`.
     *
     * Generated from protobuf field <code>string name = 3;</code>
     */
    private $name = '';
    /**
     * The new data to be added to a list of time series.
     * Adds at most one data point to each of several time series.  The new data
     * point must be more recent than any other point in its time series.  Each
     * `TimeSeries` value must fully specify a unique time series by supplying
     * all label values for the metric and the monitored resource.
     *
     * Generated from protobuf field <code>repeated .google.monitoring.v3.TimeSeries time_series = 2;</code>
     */
    private $time_series;

    public function __construct() {
        \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce();
        parent::__construct();
    }

    /**
     * The project on which to execute the request. The format is
     * `"projects/{project_id_or_number}"`.
     *
     * Generated from protobuf field <code>string name = 3;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * The project on which to execute the request. The format is
     * `"projects/{project_id_or_number}"`.
     *
     * Generated from protobuf field <code>string name = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * The new data to be added to a list of time series.
     * Adds at most one data point to each of several time series.  The new data
     * point must be more recent than any other point in its time series.  Each
     * `TimeSeries` value must fully specify a unique time series by supplying
     * all label values for the metric and the monitored resource.
     *
     * Generated from protobuf field <code>repeated .google.monitoring.v3.TimeSeries time_series = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getTimeSeries()
    {
        return $this->time_series;
    }

    /**
     * The new data to be added to a list of time series.
     * Adds at most one data point to each of several time series.  The new data
     * point must be more recent than any other point in its time series.  Each
     * `TimeSeries` value must fully specify a unique time series by supplying
     * all label values for the metric and the monitored resource.
     *
     * Generated from protobuf field <code>repeated .google.monitoring.v3.TimeSeries time_series = 2;</code>
     * @param \Google\Cloud\Monitoring\V3\TimeSeries[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setTimeSeries($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\TimeSeries::class);
        $this->time_series = $arr;

        return $this;
    }

}

